[XEN][POWERPC] Backoff the SCOM stuff by default
authorJimi Xenidis <jimix@watson.ibm.com>
Tue, 26 Sep 2006 16:42:33 +0000 (12:42 -0400)
committerJimi Xenidis <jimix@watson.ibm.com>
Tue, 26 Sep 2006 16:42:33 +0000 (12:42 -0400)
Sadly the SCOM stuff is proving to be unstable for various versions of
the chip.  I'm turning it off by default.  Also adding some PVR
decoding logic.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : %AF%13%80%A0%88%04%AE%D1Z%04%F3%DD%60%C5%E5%60%11%E6%8D%06

xen/arch/powerpc/powerpc64/ppc970_scom.c
xen/include/asm-powerpc/processor.h

index 519452ad40a92a430b77b5ab0dd5adbfa138508e..fce69a27614aa91631d5ca9f28804423fe62b2a0 100644 (file)
 #include <xen/console.h>
 #include <xen/errno.h>
 #include <asm/delay.h>
+#include <asm/processor.h>
 #include "scom.h"
 
+#undef CONFIG_SCOM
+
 #define SPRN_SCOMC 276
 #define SPRN_SCOMD 277
 #define SCOMC_READ 1
@@ -153,19 +156,29 @@ int cpu_scom_write(uint addr, ulong d)
 
 void cpu_scom_init(void)
 {
+#ifdef CONFIG_SCOM
     ulong val;
-    console_start_sync();
-    if (!cpu_scom_read(SCOM_PTSR, &val))
-        printk("SCOM PTSR: 0x%016lx\n", val);
+    if (PVR_REV(mfpvr()) == 0x0300) {
+        /* these address are only good for 970FX */
+        console_start_sync();
+        if (!cpu_scom_read(SCOM_PTSR, &val))
+            printk("SCOM PTSR: 0x%016lx\n", val);
 
-    console_end_sync();
+        console_end_sync();
+    }
+#endif
 }
 
 void cpu_scom_AMCR(void)
 {
+#ifdef CONFIG_SCOM
     ulong val;
 
-    cpu_scom_read(SCOM_AMC_REG, &val);
-    printk("SCOM AMCR: 0x%016lx\n", val);
+    if (PVR_REV(mfpvr()) == 0x0300) {
+        /* these address are only good for 970FX */
+        cpu_scom_read(SCOM_AMC_REG, &val);
+        printk("SCOM AMCR: 0x%016lx\n", val);
+    }
+#endif
 }
 
index 7d15847b0920507a32b3c62d65981bbc86736036..4893f44c36a3c2a1d1ab3f2d66fc1d23159c7247 100644 (file)
 /* most assembler do not know this instruction */
 #define HRFID .long 0x4c000224
 
+/* Processor Version Register (PVR) field extraction */
+
+#define PVR_VER(pvr)   (((pvr) >>  16) & 0xFFFF)       /* Version field */
+#define PVR_REV(pvr)   (((pvr) >>   0) & 0xFFFF)       /* Revison field */
+
+#define __is_processor(pv)     (PVR_VER(mfspr(SPRN_PVR)) == (pv))
+
+/*
+ * IBM has further subdivided the standard PowerPC 16-bit version and
+ * revision subfields of the PVR for the PowerPC 403s into the following:
+ */
+
+#define PVR_FAM(pvr)   (((pvr) >> 20) & 0xFFF) /* Family field */
+#define PVR_MEM(pvr)   (((pvr) >> 16) & 0xF)   /* Member field */
+#define PVR_CORE(pvr)  (((pvr) >> 12) & 0xF)   /* Core field */
+#define PVR_CFG(pvr)   (((pvr) >>  8) & 0xF)   /* Configuration field */
+#define PVR_MAJ(pvr)   (((pvr) >>  4) & 0xF)   /* Major revision field */
+#define PVR_MIN(pvr)   (((pvr) >>  0) & 0xF)   /* Minor revision field */
+
+/* Processor Version Numbers */
+
+#define PVR_403GA      0x00200000
+#define PVR_403GB      0x00200100
+#define PVR_403GC      0x00200200
+#define PVR_403GCX     0x00201400
+#define PVR_405GP      0x40110000
+#define PVR_STB03XXX   0x40310000
+#define PVR_NP405H     0x41410000
+#define PVR_NP405L     0x41610000
+#define PVR_601                0x00010000
+#define PVR_602                0x00050000
+#define PVR_603                0x00030000
+#define PVR_603e       0x00060000
+#define PVR_603ev      0x00070000
+#define PVR_603r       0x00071000
+#define PVR_604                0x00040000
+#define PVR_604e       0x00090000
+#define PVR_604r       0x000A0000
+#define PVR_620                0x00140000
+#define PVR_740                0x00080000
+#define PVR_750                PVR_740
+#define PVR_740P       0x10080000
+#define PVR_750P       PVR_740P
+#define PVR_7400       0x000C0000
+#define PVR_7410       0x800C0000
+#define PVR_7450       0x80000000
+#define PVR_8540       0x80200000
+#define PVR_8560       0x80200000
+/*
+ * For the 8xx processors, all of them report the same PVR family for
+ * the PowerPC core. The various versions of these processors must be
+ * differentiated by the version number in the Communication Processor
+ * Module (CPM).
+ */
+#define PVR_821                0x00500000
+#define PVR_823                PVR_821
+#define PVR_850                PVR_821
+#define PVR_860                PVR_821
+#define PVR_8240       0x00810100
+#define PVR_8245       0x80811014
+#define PVR_8260       PVR_8240
+
+/* 64-bit processors */
+/* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */
+#define PV_NORTHSTAR   0x0033
+#define PV_PULSAR      0x0034
+#define PV_POWER4      0x0035
+#define PV_ICESTAR     0x0036
+#define PV_SSTAR       0x0037
+#define PV_POWER4p     0x0038
+#define PV_970         0x0039
+#define PV_POWER5      0x003A
+#define PV_POWER5p     0x003B
+#define PV_970FX       0x003C
+#define PV_630         0x0040
+#define PV_630p        0x0041
+#define PV_970MP       0x0044
+#define PV_BE          0x0070
+
 #ifndef __ASSEMBLY__ 
 #include <xen/types.h>